Skip to content

fix(desktop): persist window size and position - #6978

Merged
ComputelessComputer merged 1 commit into
mainfrom
cursor/persist-window-size-position-f861
Aug 22, 2026
Merged

fix(desktop): persist window size and position#6978
ComputelessComputer merged 1 commit into
mainfrom
cursor/persist-window-size-position-f861

Conversation

@ComputelessComputer

Copy link
Copy Markdown
Collaborator

Joey reported that the app forgets window size and position on almost every launch, and also jumps when going from a meeting to Settings. 1.4.11 only stopped recentering after updates, so the frame still reset.

Cause

tauri-plugin-window-state keeps the saved frame in an in-memory cache. The main window was created, then immediately forced to 910×600, and the plugin’s resize listener wrote that default over the saved frame before restore ran. Re-showing an already-open window (tray, floating bar, Settings) applied that stale frame again. Leaving a meeting also restored temporary chat-panel width expansions even when chat was still open.

Fix

  • Use 910×600 as the builder default only (first launch), and restore size, position, and maximized on create before any later resize can clobber the cache.
  • Do not re-apply saved state when showing an existing window; keep the live geometry.
  • Save size, position, and maximized on quit (not size-only).
  • Restore temporary width expansions when docked chat actually closes, not when switching from a meeting to Settings.

Testing

  • pnpm -F desktop test src/shared/main/chat-panels.test.tsx
  • pnpm -F desktop typecheck
  • pnpm exec oxlint --quiet --format=github apps/desktop/src/shared/main/chat-panels.tsx apps/desktop/src/shared/main/chat-panels.test.tsx

cargo test -p tauri-plugin-windows could not run here (GTK gdk-3.0.pc is not installed in this environment).

Open in Web Open in Cursor 

The default 910x600 size was applied after window creation, which
overwrote the saved frame before restore. Showing an already-open
window also reapplied that stale state, so opening Settings from a
meeting jumped the frame.

Restore size, position, and maximized on create, keep live geometry
when showing an existing window, and stop shrinking the window just
because the user left a meeting view.

Co-authored-by: John Jeong <ComputelessComputer@users.noreply.github.com>
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for anarlog canceled.

Name Link
🔨 Latest commit 70c62cb
🔍 Latest deploy log https://app.netlify.com/projects/anarlog/deploys/6a8741367d70530008caddcd

@ComputelessComputer
ComputelessComputer marked this pull request as ready for review August 22, 2026 07:03
@ComputelessComputer
ComputelessComputer merged commit ccdc909 into main Aug 22, 2026
17 checks passed
@ComputelessComputer
ComputelessComputer deleted the cursor/persist-window-size-position-f861 branch August 22, 2026 07:03

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 70c62cb. Configure here.

(enabled && !leftPanelOpen && !rightPanelOpen)
) {
restoreWidthExpansions();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-entry re-expands unsaved width

Medium Severity

Skipping restore when leaving a meeting with docked chat open no longer matches the “panel just opened” detection. Returning to a note-surface tab still treats leftPanelOpen / rightPanelOpen as newly opened via !previousState.enabled, so the width guard can expand again on top of the already-expanded frame and stack another restorable expansion.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 70c62cb. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants